package nc.bs.test.pxt1;

import java.sql.ResultSet;
import java.sql.SQLException;

import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.jdbc.framework.processor.ResultSetProcessor;

public class Pxt1UserBp {

	private BaseDAO dao;
	
	
	public String getUserName(String usercode) throws DAOException {
		
		String sql = "select user_name from sm_user where user_code='"+usercode+"'";
		
		Object obj = dao.executeQuery(sql, new ResultSetProcessor() {
			
			@Override
			public Object handleResultSet(ResultSet rs) throws SQLException {
				return rs.next();
			}
		});
		
		return (String) obj;
	}


	public BaseDAO getDao() {
		if(dao == null) dao = new BaseDAO();
		return dao;
	}
}
